<!-- ²å¼þºóÌ¨·ÖÀà¹ÜÀí -->
<style>
.container .floattop{padding-bottom: 0;}
	#cpform thead { background: #eee;}
	#cpform th { text-align: center; border-right: 1px solid #ddd;}
	#cpform td { border-right: 1px solid #ddd; }
	.none { display: none;}
	.rq{color: #f00}
	.pipe{margin:auto 5px;color: #999;}
	#cpform .txt { width: 30px; }
	#cpform .txt2 { width: 80px; }
	[data-wenk]{position:relative}[data-wenk]:after{position:absolute;font-size:13px;border-radius:.4rem;content:attr(data-wenk);padding:12.8px;padding:.8rem;background-color:rgba(17,17,17,.8);box-shadow:0 0 14px rgba(0,0,0,.1);color:#fff;line-height:20px;line-height:1.25rem;text-align:left;z-index:1;pointer-events:none;display:block;opacity:0;visibility:hidden;-webkit-transition:all .3s;transition:all .3s;bottom:100%;left:50%;-webkit-transform:translate(-50%,10px);transform:translate(-50%,10px);white-space:pre;width:auto}[data-wenk]:after{opacity:0}[data-wenk]:hover{overflow:visible}[data-wenk]:hover:after{display:block;opacity:1;visibility:visible;-webkit-transform:translate(-50%,-10px);transform:translate(-50%,-10px)}[data-wenk].wenk--bottom,[data-wenk][data-wenk-pos="bottom"]{}[data-wenk].wenk--bottom:after,[data-wenk][data-wenk-pos="bottom"]:after{bottom:auto;top:100%;left:50%;-webkit-transform:translate(-50%,-10px);transform:translate(-50%,-10px)}[data-wenk].wenk--bottom:hover,[data-wenk][data-wenk-pos="bottom"]:hover{}[data-wenk].wenk--bottom:hover:after,[data-wenk][data-wenk-pos="bottom"]:hover:after{-webkit-transform:translate(-50%,10px);transform:translate(-50%,10px)}[data-wenk].wenk--left,[data-wenk][data-wenk-pos="left"]{}[data-wenk].wenk--left:after,[data-wenk][data-wenk-pos="left"]:after{bottom:auto;left:auto;top:50%;right:100%;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%)}[data-wenk].wenk--left:hover,[data-wenk][data-wenk-pos="left"]:hover{}[data-wenk].wenk--left:hover:after,[data-wenk][data-wenk-pos="left"]:hover:after{-webkit-transform:translate(-10px,-50%);transform:translate(-10px,-50%)}[data-wenk].wenk--right,[data-wenk][data-wenk-pos="right"]{}[data-wenk].wenk--right:after,[data-wenk][data-wenk-pos="right"]:after{bottom:auto;top:50%;left:100%;-webkit-transform:translate(-10px,-50%);transform:translate(-10px,-50%)}[data-wenk].wenk--right:hover,[data-wenk][data-wenk-pos="right"]:hover{}[data-wenk].wenk--right:hover:after,[data-wenk][data-wenk-pos="right"]:hover:after{-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%)}[data-wenk][data-wenk-length="small"]:after,[data-wenk].wenk-length--small:after{white-space:normal;width:80px}[data-wenk][data-wenk-length="medium"]:after,[data-wenk].wenk-length--medium:after{white-space:normal;width:150px}[data-wenk][data-wenk-length="large"]:after,[data-wenk].wenk-length--large:after{white-space:normal;width:260px}[data-wenk][data-wenk-length="fit"]:after,[data-wenk].wenk-length--fit:after{white-space:normal;width:100%}[data-wenk][data-wenk-align="right"]:after,[data-wenk].wenk-align--right:after{text-align:right}[data-wenk][data-wenk-align="center"]:after,[data-wenk].wenk-align--center:after{text-align:center}[data-wenk=""]:after{visibility:hidden!important}
</style>
<script>
	var jameson_admin = {
		/*Ìí¼Ó±à¼­Í¼ÊéÊ±ÇÐ»»Í¼Êé·ÖÀà*/
		changeCategory:function(e){
			var parent_id = parseInt(e.value);
			var book_id = e.getAttribute('data-bid');
			jameson_admin.editclass(parent_id,book_id);
		},
		editclass:function(pid,book_id){
			var dom = $('selectcategory_'+book_id).parentNode.getElementsByTagName('select');
			for(var i=1,len=dom.length;i<len;i++){
				if(dom[i].id != 'selectcategory_'+book_id+'_'+pid+'_menu'){
					dom[i].classList.add('none');
				}else{
					dom[i].classList.remove('none');
				}
			}
		},
		selectall:function(em){
			if(em.getAttribute('data-select') == 1){
				em.setAttribute('data-select','2');
				var stats = true;
			}else{
				em.setAttribute('data-select','1');
				var stats = false;
			}
			var checkboxall = document.getElementsByTagName('input');
			for(var i=0,len = checkboxall.length;i<len;i++){
				if(checkboxall[i].getAttribute('type') == 'checkbox'){
					checkboxall[i].checked = stats;
				}
			}
		},
		searchauthorbook:function(){
			var bookname = trim($("searchbookname").value);
			if(!bookname){
				alert('{lang jameson_read:shurutushumingzi}');
				return;
			}
			location.href = '{ADMINSCRIPT}?action=plugins&operation=config&do={$_GET["do"]}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=index&'+'book_name='+encodeURIComponent(bookname);
		},
		selectbycid:function(cid){
			console.log(cid)
			if(cid){
			location.href = '{ADMINSCRIPT}?action=plugins&operation=config&do={$_GET["do"]}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=index&category_id='+cid
			}
		}
	};
</script>
<div class="cl">
	<div class="left">
		<input type="text" class="txt" onkeydown="if(event.keyCode==13)jameson_admin.searchauthorbook();" placeholder="{lang jameson_read:shurutushuhuozuozhemingzi}" value="{$keybookname}"  id="searchbookname" />
		<a href="javascript:;" onclick="jameson_admin.searchauthorbook()" class="btn ptn pbn pln prn" >{lang jameson_read:soushu}</a>
	</div>
	<div class="right">
		<label><strong>{lang jameson_read:anfenleixunzhao}</strong></label>
		<select onchange="jameson_admin.selectbycid(this.value)">
			<option value="0">{lang jameson_read:xuanzefenlei}</option>
			{loop $categorys $value}
				<option {if $_GET['category_id']==$value['category_id']}selected{/if} value="{$value['category_id']}">
				[{$value['category_name']}]</option>
				{loop $value['sub'] $sub}
					<option {if $_GET['category_id']==$sub['category_id']}selected{/if} value="{$sub['category_id']}">
					&nbsp;&nbsp;&nbsp;{$sub['category_name']}</option>
				{/loop}
			{/loop}
		</select>
	</div>
</div>
<form id="cpform" action="?action=plugins&operation=config&do={$_GET['do']}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=post" autocomplete="off" method="post" name="cpform">
<table class="tb tb2">
<thead class="">
	<tr class="header ">
		<th class="txt2"><a href="javascript:;" data-select="1" onclick="jameson_admin.selectall(this)" id="quanxuan" class="quanxuan">{lang jameson_read:shanchu}</a>{lang jameson_read:xuhao}</th>
		<th>{lang jameson_read:shuming}</th>
		<th>{lang jameson_read:fenlei}</th>
		<th>{lang jameson_read:zuozhe}/{lang jameson_read:yonghu}UID</th>
		<th><a data-wenk="{lang jameson_read:dianjipaixu}" data-wenk-pos="right" href='{ADMINSCRIPT}?action=plugins&operation=config&do={$_GET["do"]}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=index&byfield=zishu&{if !isset($_GET["order"]) || ($_GET["order"]=="asc")}order=desc&{else}order=asc&{/if}{if $_GET["category_id"]}category_id={$_GET["category_id"]}{/if}'>{lang jameson_read:zishu}{if $_GET['byfield']=='zishu'}{if !isset($_GET["order"]) || ($_GET["order"]=="asc")}&uarr;{else}&darr;{/if}{/if}</a></th>
		<th><a  href='{ADMINSCRIPT}?action=plugins&operation=config&do={$_GET["do"]}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=index&byfield=is_top&{if !isset($_GET["order"]) || ($_GET["order"]=="asc")}order=desc&{else}order=asc&{/if}{if $_GET["category_id"]}category_id={$_GET["category_id"]}{/if}'>{lang jameson_read:tuijian}{if $_GET['byfield']=='is_top'}{if !isset($_GET["order"]) || ($_GET["order"]=="asc")}&uarr;{else}&darr;{/if}{/if}</a></th>
		<th><a  href='{ADMINSCRIPT}?action=plugins&operation=config&do={$_GET["do"]}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=index&byfield=sign&{if !isset($_GET["order"]) || ($_GET["order"]=="asc")}order=desc&{else}order=asc&{/if}{if $_GET["category_id"]}category_id={$_GET["category_id"]}{/if}'>{lang jameson_read:qianyuezhuangtai}{if $_GET['byfield']=='sign'}{if !isset($_GET["order"]) || ($_GET["order"]=="asc")}&uarr;{else}&darr;{/if}{/if}</a></th>
		<th>{lang jameson_read:bangdingbankuai}/{lang jameson_read:qunzu}</th>
		<th>{lang jameson_read:caozuo}</th>
	</tr>
</thead>
<tbody>
{loop $books $key $book}
	<tr class="hover threadopt">
		<td data-wenk-pos="right" data-wenk="{lang jameson_read:xuanzhongtijiaoshanchu}">&times;<input  name="delbook[{$book['book_id']}]" type="checkbox" />{eval echo ++$key;}{if $book['plan']}.[{lang jameson_read:wan}]{/if}</td>
		<td>
			<input class="" type="text" name="name[{$book['book_id']}]" value="{$book['book_name']}" />
			<a href="./plugin.php?id=jameson_read&contrl=index&act=book&book_id={$book['book_id']}" target="_blank">{lang jameson_read:yu}</a>
		</td>
		<td>
			<select name="parent_id[{$book['book_id']}]" id="selectcategory_{$book['book_id']}" onchange="jameson_admin.changeCategory(this)" data-bid="{$book['book_id']}"  class="">
					<option>{lang jameson_read:xuanzefenlei}</option>
			{loop $categorys $value}
					<option {if $value['category_id'] == $book['parent_id']}selected{/if} value="{$value['category_id']}">{$value['category_name']}</option>
			{/loop}
			</select>
			{loop $categorys $value}
			<select name="category_id[{$book['book_id']}][{$value['category_id']}]" id="selectcategory_{$book['book_id']}_{$value['category_id']}_menu" class="{if $value['category_id'] != $book['parent_id']}none{/if}">
				<option>{lang jameson_read:xuanzefenlei}</option>
				{loop $value['sub'] $sub}
					<option {if $sub['category_id'] == $book['category_id']}selected{/if}  value="{$sub['category_id']}">{$sub['category_name']}</option>
				{/loop}
			</select>
			{/loop}
		</td>
		<td><a target="_blank" href="./plugin.php?id=jameson_read&contrl=index&act=zuozhe&zuozhe_name={$book['author']}">{$book['author']}</a> / <a target="_blank" href="./home.php?mod=space&uid={$book['uid']}">{$book['uid']}</a></td>
		<td><input type="text" class="txt2" name="zishu[{$book['book_id']}]" value="{$book['zishu']}" /></td>
		<td>
			<select name="is_top[{$book['book_id']}]">
				<option value="1" {if $book['is_top'] == 1}selected{/if}>{lang jameson_read:yes}</option>
				<option value="0" {if $book['is_top'] == 0}selected{/if}>{lang jameson_read:no}</option>
			</select>
		</td>
		<td>
			<select name="sign[{$book['book_id']}]">
				<option value="1" {if $book['sign'] == 1}selected{/if} >{lang jameson_read:yiqianyue}</option>
				<option value="0" {if $book['sign'] == 0}selected{/if}>{lang jameson_read:weiqianyue}</option>
			</select>
		</td>
		<td>
			<select name="forum[{$book['book_id']}]">
				<option value="0">{lang jameson_read:xuanzebankuai}</option>
				{loop $forumlist $key $forum}
					<optgroup label="{$forum['name']}">
						{loop $forum['sub'] $fsub}
						{if $fsub['fid'] != $_G['jameson_read']['fid']}
							<option value="{$fsub['fid']}" {if $fsub['fid'] == $book['bindfid']}selected{/if}>{$fsub['name']}</option>
						{/if}
						{/loop}
					</optgroup>
				{/loop}
			</select>
			<select name="qunzu[{$book['book_id']}]">
				<option>{lang jameson_read:xuanzequnzu}</option>
				{loop $qzs $qz}
					<optgroup label="{$qz['name']}[{lang jameson_read:fenlei}]">
						{loop $qz['sub'] $qzsub}
							<option disabled>{$qzsub['name']}[{lang jameson_read:fenlei}]</option>
							{loop $qzsub['qunzu'] $zu}
								<option {if $zu['fid']==$book['qzfid']} selected {/if} value="{$zu['fid']}">{$zu['name']}</option>
							{/loop}
						{/loop}
					</optgroup>
				{/loop}
			</select>
		</td>
		<td>
			<a href="?action=plugins&operation=config&do={$_GET['do']}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=del&book_id={$book['book_id']}&formhash={FORMHASH}" class=" mlm mrm">{lang jameson_read:shanchu}</a>
			<a class="mlm mrm " href="?action=plugins&operation=config&do={$_GET['do']}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=xiajia&book_id={$book['book_id']}&formhash={FORMHASH}">{lang jameson_read:xiajia}</a>
			{if !$book['is_pdf']}
			<a target="_blank" class="mlm mrm " href="?action=plugins&operation=config&do={$_GET['do']}&identifier=jameson_read&pmod=jameson_read&contrl=mbook&act=guanli&book_id={$book['book_id']}&formhash={FORMHASH}">{lang jameson_read:guanli}</a>
			{/if}
		</td>
	</tr>
{/loop}
	<tr>
		<td colspan="9">
			<input type="hidden" name="formhash" value="{FORMHASH}">
			<input id="submit_editsubmit" class="btn" type="submit" value="{lang jameson_read:tijiao}{lang jameson_read:xiugai}" name="editsubmit">
			<span class="rq">{lang jameson_read:shanchuxuanzhong}</span>
		</td>
	</tr>
</tbody>
</table>
{if $books}
<div class="margintop marginbot cl right">{$pageshow}</div>
{/if}
</form>
<script type="text/javascript" src="./source/plugin/jameson_read/template/adm.js"></script>